<%--
  Created by IntelliJ IDEA.
  User: XYC
  Date: 2015/7/9
  Time: 13:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ include file="/WEB-INF/jsp/component/common.jsp" %>

<link href="${css}/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- DataTables CSS -->
<link href="${css}/dataTables.bootstrap.css" rel="stylesheet">
<link href="${css}/bootstrap-datetimepicker.min.css"  rel="stylesheet" media="screen">
<!-- DataTables Responsive CSS -->
<link href="${css}/dataTables.responsive.css" rel="stylesheet">
<!-- button -->
<link rel="stylesheet" type="text/css" href="${assets}/button/css/btn.css"/>

<link rel="stylesheet" href="${dean}/css/message.css" type="text/css"/>
<%--onresize="reSizeParentIframe('#iframe1','400')"--%>
<body >
  <div class="hd">
    <div class="back">
      <%--<button onclick="history.go(-1)"></button>--%>
      <button onclick="showDetail(9)"></button>
    </div>
    <div class="info">
      <div class="photo">
        <%--<img src="${dean}/img/pic.png"/>--%>
        <img src="data:image/png;base64,${patient.userImage}" onerror="this.src='${dean}/img/pic.png'" style="height: 54px; width: 51px"/>
      </div>
      <p>
        <span>姓&nbsp;&nbsp;&nbsp;&nbsp;名：${patient.realname}</span>
        <span>${sex}：${age}</span>
        <span>档案编号：${patient.medicalInsuranceNum}</span>
      </p>
      <p>
        <span>身份证号：${patient.idCard}</span>
        <span>卡号：${patient.medicalCardNum}</span>
      </p>
    </div>
    <div class="menu">
      <button class="act"  onclick="showDetail(0)">个人档案</button>
      <button  onclick="showDetail(1)">体检数据</button>
      <button  onclick="showDetail(2)">健康调查</button>
      <button  onclick="showDetail(0)">历史用药</button>
    </div>
  </div>
 <%--    <div class="back">
       <button onclick="history.go(-1)"></button>
     </div>
     <div class="info">
       <div class="photo">
         <img src="${theme}/img/pic.png" />
       </div>
       <p>
         <span>姓&nbsp;&nbsp;&nbsp;&nbsp;名：${patient.realname}</span> <span>${patient.sex}：${patient.age}</span>
         <span>档案编号</span>
       </p>
       <p>
         <span>身份证号：${patient.idCard}</span> <span>就诊卡号：${patient.medicalCardNum}</span>
       </p>
     </div>
     <div class="menu">
       <button>个人档案</button>
       <button class="act">体检记录</button>
       <button class="last">历史用药</button>
     </div>
  </div>--%>
  <div class="cl"></div>
  <!-- 选项卡内容部分开始 -->
  <div class="bd">
    <span class="select  select1">生活环境</span>
    <span class="select  select2">家庭问题</span>
    <span class="select  select3">家庭信息</span>
    <span class="select  select4" onclick='changeIfreamPath("${ctx}","disability/PageShow","${patient.idCard}","667")'>残疾情况</span>
    <span class="select  select5" onclick='changeIfreamPath("${ctx}","geneticHistory/PageShow","${patient.idCard}","667")'>遗传史</span>
    <span class="select  select6" onclick='changeIfreamPath("${ctx}","pastHistory/PageShow","${patient.idCard}","667")'>既往史</span>
    <span class="select  select7" onclick='changeIfreamPath("${ctx}","familyHistory/PageShow","${patient.idCard}","667")'>家族史</span>
    <span class="select  select8" onclick='changeIfreamPath("${ctx}","allergicHistory/PageShow","${patient.idCard}","667")'>过敏史 </span>
    <span class="select  select9" onclick='changeIfreamPath("${ctx}","expodeHistory/PageShow","${patient.idCard}","667")'>暴露史</span>
    <span class="select  select10" >签约情况</span>
    <span class="select  select11" onclick='changeIfreamPath("${ctx}","insurance/Get","${patient.idCard}","667")'>保险类别</span>
    <span class="select  select12 cur" onclick='changeIfreamPath("${ctx}","archives/Get","${patient.idCard}","667")'>个人档案</span>
  </div>
  <div class="blank"><%--onload="iFrameHeight('patientBody')"  onload="iFrameHeight('patientBody',667);"--%>
      <iframe id="patientBody" src="${ctx}/web/patient/archives/Get?idCard=${patient.idCard}" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"   style=" height: 667px; width: 876px; margin-top:34px;  position:relative" scrolling="NO" frameborder="0">
      </iframe>
    </div>
    <div class="ft_r"></div>
<div  class="modal fade" id="dialog-Show"></div>
</body>
<script src="${dean}/js/jquery-1.11.1.js"></script>
<script src="${dean}/js/baseDell.js"></script>
<%--<script src="${dean}/js/jquery-1.11.1.min.js"></script>--%>
<!-- DataTables JavaScript -->
<script src="${js}/jquery.dataTables.js"></script>
<script src="${js}/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="${js}/bootstrap-dateTime/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="${js}/bootstrap-dateTime/locales/bootstrap-datetimepicker.zh-CNxyc.js" ></script>
<script src="${js}/bootbox.js"></script>
<!-- button -->
<script src="${assets}/button/js/btn.js"></script>
  <script src="${dean}/js/message.js" type="text/javascript"></script>
<script src="${js}/dean.js" type="text/javascript"></script>
<script type="text/javascript">
    function initDateTime(dataId){
        $(dataId).datetimepicker({
            language:  'zh-CN',
            weekStart:  0,
            todayBtn: true,
            autoclose:  1,
            todayHighlight: 1,
            startView: 2,
            minView: 2,
            forceParse: 0
        });
    }
    function showDetail(obj){
        var url="#";
        switch(obj){
            case 1: url = "${ctx}/Exam/init?obj=exams1&idCard=${patient.idCard}";break;
            case 9: url = "${ctx}/Exam/init?obj=patients";break;
        }
       //
        location.href = url;
    }

//    var iFrameHeightVar = function iFrameHeight(iframeid ,defineHight ,extraheight) {
    function iFrameHeight(iframeid ,defineHight ,extraheight) {
        var ifm= document.getElementById(iframeid);
        $("#"+iframeid).css("height",defineHight);
        var subWeb = document.frames ? document.frames[iframeid].document :
                ifm.contentDocument;
        if(ifm != null && subWeb != null) {
//            ifm.height = (subWeb.body.scrollHeight+60)+"px";
            if(defineHight<subWeb.body.scrollHeight){
//                ifm.height = subWeb.body.scrollHeight;
                $("#"+iframeid).css("height",subWeb.body.scrollHeight);
            }else{
//                ifm.height = defineHight;
                $("#"+iframeid).css("height",defineHight);
            }

            if(extraheight !=null || extraheight!=undefined){
                ifm.height = subWeb.body.scrollHeight+extraheight;//+60
            }
        }
        setTimeout(reSizeParentIframe('#iframe1','400'),500);
//        reSizeParentIframe('#iframe1','400');
        //var tabcontent = document.getElementById('tablecontent');
        //var tabcontentWeb= document.frames ? document.frames["tablecontent"].document :
        //    tabcontent.contentDocument;
        //if(tabcontent !=null && tabcontentWeb !=null){
        //    tabcontent.height=tabcontentWeb.body.scrollHeight;
        //}
    }
</script>
